package com.yuandian.management.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuandian.api.management.entity.ConfBusiness;
import com.yuandian.bpm.common.data.datascope.BpmBaseMapper;
import com.yuandian.management.vo.SearchOptionVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 业务配置表-Mapper接口
 */
@Mapper
public interface ConfBusinessMapper extends BpmBaseMapper<ConfBusiness> {

	/**
	 * 判断业务名称是否重复
	 * @param confBusiness 业务配置
	 * @return
	 */
	Integer checkBusiNameDuplicates(@Param("param") ConfBusiness confBusiness);


	/**
	 * 通过系统id获取改系统下的业务数
	 * @param systemIds 主键
	 * @return 通用返回对象
	 */
	List<Map<String, Integer>> getBusinessCountBySystemIds(@Param("systemIds") List<Integer> systemIds);


	/**
	 * 分页查询
	 *
	 * @param confBusiness 筛选条件
	 * @return 通用返回对象
	 */
    Page<ConfBusiness> listPage(Page<ConfBusiness> confBusinessPage, @Param("params") ConfBusiness confBusiness);

	/**
	 * 通过系统id查询已确认的关键业务列表(远程接口）
	 *
	 * @param systemId 业务vo
	 * @return 通用返回对象
	 */
    List<ConfBusiness> queryKeyBusinessBySystemId(@Param("systemId") Integer systemId);

	/**
	 * 根据步骤编码查询所诉业务
	 * @param stepCodes 步骤编码列表
	 * @return 通用返回对象
	 */
    List<String> queryBusinessCodeListByStepCode(@Param("stepCodes") List<String> stepCodes);

	List<ConfBusiness> queryBySystemCodeAndName(@Param("params") ConfBusiness syBus);


	/**
	 * 通过系统id查询已确认的业务列表
	 * @param systemId 系统id
	 * @return 搜索选项vo对象集合
	 */
	List<SearchOptionVo> queryBusinessBySystemId(@Param("systemId") Integer systemId);

}
